/*******************************************************************************
 * Copyright:   Copyright (c) 2007. Hisilicon Technologies, CO., LTD. 
 * Version:      V300R001B866
 * Filename:    AcodecBase.h
 * Description: Audio driver codec head file
 * History:
                1.Created by Richard(55798) on 2008/12/17
                2.Date: 2008-12-22 11:30
                  Author: H55798
                  Issue Number: AT4D02739
                  Modification: Add user codec control module;
                3.Date: 2009-2-24 20:12
                  Author: H55798
                  Issue Number: AT4D03153
                  Modification: Headset unpop control circuit control;
                4.Date: 2009-2-25 16:58
                  Author: H55798
                  Issue Number: AT4D03165
                  Modification: Create two new speaker wave channel application profile;
                5.Date: 2009-7-28 14:18
                  Author: H55798
                  Issue Number: AT4D03923
                  Modification: Speaker phone recharge issue; 
*******************************************************************************/

#ifndef __ACODECBASE_H__
#define __ACODECBASE_H__

#include "HI6421CODEC.h"
#include "hisi6810_gpio.h"


//==========================================================================
// Registry value name of all codec PGAs' volume
//==========================
#define ACODEC_NAME_WAVEDACV            (L"AcodecWaveDacVol")
#define ACODEC_NAME_WAVESPKHSV          (L"AcodecWaveRecvSpkHsVol")
#define ACODEC_NAME_CALLRECVSPKHSV      (L"AcodecCallRecvSpkHsVol")
#define ACODEC_NAME_CALLLINEINOUTV      (L"AcodecCallLineInOutVol")
#define ACODEC_NAME_CALLMICBSTAMPV      (L"AcodecCallMicBstAmpVol")
#define ACODEC_NAME_CALLUPLINKSIDEV     (L"AcodecCallUplinkSideVol")
#define ACODEC_NAME_CALLBTDACADCV       (L"AcodecCallBtDacAdcVol")
#define ACODEC_NAME_RECMICBSTAMPV       (L"AcodecRecMicBstAmpVol")
#define ACODEC_NAME_RECBST2ADCV         (L"AcodecRecBst2AdcVol")
#define ACODEC_NAME_CALLDLINKRECVV      (L"AcodecCallDlinkRecvVol")
#define ACODEC_NAME_CALLDLINKSPKV       (L"AcodecCallDlinkSpkVol")
#define ACODEC_NAME_CALLDLINKHSLV       (L"AcodecCallDlinkHslVol")
#define ACODEC_NAME_CALLDLINKHSRV       (L"AcodecCallDlinkHsrVol")
#define ACODEC_NAME_CALLULINKBDSTV      (L"AcodecCallUlinkBdStVol")
#define ACODEC_NAME_CALLULINKHSSTV      (L"AcodecCallUlinkHsStVol")

#define ACODEC_NAME_CALLRECVWAVEDACV    (L"AcodecCallWaveRecvDacVol")
#define ACODEC_NAME_CALLSPKWAVEDACV     (L"AcodecCallWaveSpkDacVol")
#define ACODEC_NAME_CALLHSWAVEDACV      (L"AcodecCallWaveHsDacVol")
#define ACODEC_NAME_CALLBTWAVEDACV      (L"AcodecCallWaveBtDacVol")

// Gain compensate step for wave play in-call status
#define ACODEC_NAME_GAINCOMPENSATE      (L"GainCompensateStep")
// Enable/Disable sidetone
#define ACODEC_NAME_CALLSIDETONE_RECV   (L"OngoingCallSidetoneReceiver")
#define ACODEC_NAME_CALLSIDETONE_HS     (L"OngoingCallSidetoneHeadset")
//==========================================================================


//==========================================================================
// Define codec register setting trace profile
//==========================
#define ACODEC_TRACE_NONE               (0)
#define ACODEC_TRACE_BASE               (1UL)
#define ACODEC_TRACE_INITIALIZE         (ACODEC_TRACE_BASE<<0)
#define ACODEC_TRACE_WAVEPLAY           (ACODEC_TRACE_BASE<<1)
#define ACODEC_TRACE_FMPLAY             (ACODEC_TRACE_BASE<<2)
#define ACODEC_TRACE_RECORD             (ACODEC_TRACE_BASE<<3)
#define ACODEC_TRACE_CALL               (ACODEC_TRACE_BASE<<4)
#define ACODEC_TRACE_JACK               (ACODEC_TRACE_BASE<<5)
#define ACODEC_TRACE_SPEAKER            (ACODEC_TRACE_BASE<<6)
#define ACODEC_TRACE_BLUETOOTH          (ACODEC_TRACE_BASE<<7)
#define ACODEC_TRACE_STREAMMUTE         (ACODEC_TRACE_BASE<<8)
#define ACODEC_TRACE_CALL_CHANNEL       (ACODEC_TRACE_CALL          \
                                        |ACODEC_TRACE_JACK          \
                                        |ACODEC_TRACE_SPEAKER       \
                                        |ACODEC_TRACE_BLUETOOTH)
#define ACODEC_TRACE_APPLICATION        (ACODEC_TRACE_WAVEPLAY      \
                                        |ACODEC_TRACE_FMPLAY        \
                                        |ACODEC_TRACE_RECORD        \
                                        |ACODEC_TRACE_CALL)
#define ACODEC_TRACE_ALL                (ACODEC_TRACE_APPLICATION   \
                                        |ACODEC_TRACE_CALL_CHANNEL  \
                                        |ACODEC_TRACE_STREAMMUTE)
//==========================================================================


//==========================================================================
// Define codec PGA volume ramping operation
//==========================
#define DO_VOLUMEGRAMP                  (TRUE)
#define NOT_VOLUMERAMP                  (FALSE)
//==========================================================================


//==========================================================================
// Define LineIn1 PGA volume default limit value and max limit value
//==========================
#define LINEIN1_PGA_DEFAULT             (4)
#define LINEIN1_PGA_LIMIT               (8)
//==========================================================================


//==========================================================================
// Define MIC AMP boost enable and disable
//==========================
#define MIC_AMP_BOOST_EN                (1)
#define MIC_AMP_BOOST_DIS               (0)
//==========================================================================


//==========================================================================
// Default codec PGAs volume can be mapped to registry
//==========================
#ifdef AUDIO_MOBILEXP
#define ACODEC_DEFAULT_WAVEDACV             (0xFFFFFFFF)        // 4294967295
#define ACODEC_DEFAULT_CALLRECVSPKHSV       (0x0D0E0B0B)        // 219024139
#ifdef HI6421_V160_MP
#define ACODEC_DEFAULT_WAVERECVSPKHSV       (0x0E0E0B0B)        // 235801355
//#define ACODEC_DEFAULT_CALLLINEINOUTV       (0x040A0A0A)        // 67766794
#define ACODEC_DEFAULT_CALLUPLINKSIDEV      (0x000F0E0F)        //  986639
//#define ACODEC_DEFAULT_CALLMICBSTAMPV       (0x01040104)        // 17039620
#define ACODEC_DEFAULT_CALLMICBSTAMPV       (0x01050105)        // 17105157
#define ACODEC_DEFAULT_RECBST2ADCV          (0x0101F1AD)        //  16904621
//#define ACODEC_DEFAULT_RECMICBSTAMPV        (0x01040104)        // 17039620
#define ACODEC_DEFAULT_RECMICBSTAMPV        (0x01050105)        // 17105157
#else // else HI6421_V160_MP
#define ACODEC_DEFAULT_WAVERECVSPKHSV       (0x0E0E0B0B)        // 235801355
//#define ACODEC_DEFAULT_CALLLINEINOUTV       (0x040A0A0A)        // 67766794
#define ACODEC_DEFAULT_CALLUPLINKSIDEV      (0x000D0C0D)        //  855053
#define ACODEC_DEFAULT_CALLMICBSTAMPV       (0x01080108)        // 17301768
#define ACODEC_DEFAULT_RECBST2ADCV          (0x0000F1AD)        //  61869
#define ACODEC_DEFAULT_RECMICBSTAMPV        (0x01080108)        // 17301768
#endif  // end HI6421_V160_MP
#define ACODEC_DEFAULT_CALLBTDACADCV        (0xFFFFF1AD)        //  4294963629
#else   // else AUDIO_MOBILEXP, B831
#define ACODEC_DEFAULT_WAVEDACV             (0xFFFFFFFF)        // 4294967295
#define ACODEC_DEFAULT_CALLRECVSPKHSV       (0x0D0D0A0A)        // 218958346
#ifdef HI6421_V160_MP
#define ACODEC_DEFAULT_WAVERECVSPKHSV       (0x0E0D0A0A)        // 235735562
//#define ACODEC_DEFAULT_CALLLINEINOUTV       (0x040A0909)        // 67766537
#define ACODEC_DEFAULT_CALLUPLINKSIDEV      (0x000B0B0B)        //  723723
#define ACODEC_DEFAULT_CALLMICBSTAMPV       (0x01040104)        // 17039620
#define ACODEC_DEFAULT_RECBST2ADCV          (0x0101F1AD)        //  16904621
#define ACODEC_DEFAULT_RECMICBSTAMPV        (0x01040104)        // 17039620
#else   // else HI6421_V160_MP
#define ACODEC_DEFAULT_WAVERECVSPKHSV       (0x0E0D0A0A)        // 235735562
//#define ACODEC_DEFAULT_CALLLINEINOUTV       (0x040A0909)        // 67766537
#define ACODEC_DEFAULT_CALLUPLINKSIDEV      (0x00090909)        //  592137
#define ACODEC_DEFAULT_CALLMICBSTAMPV       (0x01070107)        // 17236231
#define ACODEC_DEFAULT_RECBST2ADCV          (0x0000F1AD)        //  61869
#define ACODEC_DEFAULT_RECMICBSTAMPV        (0x01070107)        // 17236231
#endif  // end HI6421_V160_MP
#define ACODEC_DEFAULT_CALLBTDACADCV        (0xFFFFF1AD)        //  4294963629
#endif  // end AUDIO_MOBILEXP

#define ACODEC_MAX_COMPENSATEGAIN           (0x003F3F3F)        // Hs,Spk,Recv
//==========================================================================


//==========================================================================
// [enum] Ongoing call sidetone
//==========================
typedef enum _ONGOING_CALL_SIDETONE
{
    CALL_ST_RECV = 0,   // Sidetone for receiver ongoing call channel
    CALL_ST_HS   = 1    // Sidetone for headset ongoing call channel
}EONGOINGCALLST, *PEONGOINGCALLST;
#define ONGOINGCALLSIDEOBJ    2
//==========================================================================


//==========================================================================
// [enum] Headset unpop circuit power and switch event
//==========================
typedef enum _HEADSET_UNPOP_CIRCUIT_POWER_EVENT
{
    ACODEC_DRV_INIT                  = 0,   // system was powered on, audio driver was being loaded and audio hardware was initializing
    ACODEC_DRV_DEINIT                = 1,   // reserved
    ACODEC_JACKIN_BF_MICBIAS_ON      = 2,   // headset was inserted, set power event before microphone bias power on
    ACODEC_JACKIN_AF_MICBIAS_ON      = 3,   // headset was inserted, set power event after microphone bias power on
    ACODEC_JACKOUT_BF_MICBIAS_OFF    = 4,   // headset was removed, set power event before microphone bias power off
    ACODEC_JACKOUT_AF_MICBIAS_OFF    = 5,   // headset was removed, set power event after microphone bias power off
    ACODEC_JACKOUT_AF_INTERRUPT_DONE = 6    // headset was removed, set power event after all jack out process have been finished
}EHSUNPOPCIRCUITPWR, *PEHSUNPOPCIRCUITPWR;

typedef enum _HEADSET_PGA_SETTING_EVENT
{
    //-------------------------------------------------------------------------------
    // PGA power on/off operate: 
    // PGA will be power on and off, mute and no mute, it's gain will be ramp up and down
    // on flow: power on -> no mute -> gain ramp up
    // off flow: gain ramp down -> mute -> power off
    //
    // PGA ramp operate: 
    // PGA will be mute and no mute, it's gain will be ramp up and down, but never power on and off
    // ramp down flow: gain ramp down -> mute
    // ramp up flow:  no mute -> gain ramp up
    //-------------------------------------------------------------------------------
    ACODEC_BF_HS_PGA_ON         = 0,  // PGA will be powered on
    ACODEC_BF_HS_PGA_NOMUTE     = 1,  // PGA was just powered on, but was muted
    ACODEC_BF_HS_PGA_GAINUP     = 2,  // PGA was just powered on and was no mute, current PGA gain was -42dB
    ACODEC_AF_HS_PGA_GAINUP     = 3,  // PGA was on and no mute, current gain was user defined value
    ACODEC_BF_HS_PGA_GAINDOWN   = 4,  // PGA will be off and mute, current gain was user defined value
    ACODEC_BF_HS_PGA_MUTE       = 5,  // PGA was on and no mute, but current PGA gain was -42dB
    ACODEC_BF_HS_PGA_OFF        = 6,  // PGA was on, but muted
    ACODEC_AF_HS_PGA_OFF        = 7,  // PGA was just powered off
    ACODEC_BF_HS_PGA_RAMPDOWN   = 8,  // PGA will just be muted and it's gain will be ramped down , but the PGA will not be off
    ACODEC_BF_HS_PGA_RAMPMUTE   = 9,  // PGA's gain was set to -42dB, but not mute, and would never be powered off
    ACODEC_AF_HS_PGA_RAMPMUTE   = 10, // PGA was muted, but still powered on, 
    ACODEC_BF_HS_PGA_RAMPNOMUTE = 11, // PGA was still powered on, and would just be no mute
    ACODEC_BF_HS_PGA_RAMPUP     = 12, // PGA was still powered on,  and was set to no mute, current PGA gain was -42dB
    ACODEC_AF_HS_PGA_RAMPUP     = 13  // // PGA was on and no mute, current gain was user defined value
}EHSPGAEVENT, *PEHSPGAEVENT;
//==========================================================================


//==========================================================================
// [enum] Define device input channel event
//==========================
typedef enum _RECORD_EVENT_OBJ
{
    RECORD_MIC = 0,         // Microphone input
    RECORD_LINEIN = 1,      // FM input
    RECORD_TELEPHONE = 2,   // Normal telephone input
    RECORD_BTSPEECH = 3,    // Bluetooth speech recognition
    RECORD_NONE = 4         // Current Record default status for m_eCurrRecObjSelected only
}ERECORDOBJ, *PERECORDOBJ;
//==========================================================================


//==========================================================================
// [enum] Define system/device gain and mute related 
//==========================
typedef enum _DEVICE_GAIN_OBJ
{
    DEVICE_GAIN_SYSTEM  = 0,     // Device gain setting from system  
    DEVICE_GAIN_PHONE   = 1,       // Device gain setting from phone
    DEVICE_GAIN_NONE    = -1
}EDEVICEGAINOBJ, *PEDEVICEGAINOBJ;
#define DEVICE_GAIN_NUM     2

typedef enum _OUTPUTPGA_GAIN_SETTING_OBJ
{
    OUTPUTPGA_GAIN_RECEIVER      = 0,       // Device gain setting for receiver output PGA
    OUTPUTPGA_GAIN_SPEAKER       = 1,       // Device gain setting for speaker output PGA
    OUTPUTPGA_GAIN_HEADSETL      = 2,       // Device gain setting for headphone output PGA
    OUTPUTPGA_GAIN_HEADSETR      = 3,       // Device gain setting for headphone output PGA
    OUTPUTPGA_GAIN_BLUETOOTH     = 4,       // Device gain setting for bluetooth output PGA
    OUTPUTPGA_GAIN_BDMICSIDETONE = 5,       // Device gain setting for board mic sidetone PGA
    OUTPUTPGA_GAIN_HSMICSIDETONE = 6,       // Device gain setting for headset mic sidetone PGA
    OUTPUTPGA_GAIN_NONE          = -1       // Device gain setting to none
}EOUTPUTPGAGAINSETTINGOBJ, *PEOUTPUTPGAGAINSETTINGOBJ;
#define OUTPUTPGA_GAIN_NUM      7

typedef enum _OUTPUTGAIN_LEVEL
{
    OUTPUTGAIN_LEVEL0 = 0,
    OUTPUTGAIN_LEVEL1 = 1,
    OUTPUTGAIN_LEVEL2 = 2,
    OUTPUTGAIN_LEVEL3 = 3,
    OUTPUTGAIN_LEVEL4 = 4,
    OUTPUTGAIN_MUTE   = 5,
    OUTPUTGAIN_NONE   = -1
}EOUTPUTGAINLEVEL, *PEOUTPUTGAINLEVEL;
#define OUTPUTGAIN_LEVEL_NUM      6
//==========================================================================


//==========================================================================
// [enum] Define speaker channel output profile
// Four speaker hardware output profile will be supported: 
// stereo speaker output with/without external PA profile
// mono speaker output with/without external PA profile
//==========================
typedef enum _SPEAKER_OUT_PROFILE
{
    SPK_MONO_ONLY_PROFILE    = 0,       // Mono speaker output without external PA , [stereo wave -> mono mixer -> mono wave ->LSP PGA -> mono speaker output]
    SPK_MONO_EX_PA_PROFILE   = 1,       // Mono speaker output with external PA , [stereo wave -> mono mixer -> mono wave ->LSP PGA -> External PA -> mono speaker output] 
    SPK_STEREO_ONLY_PROFILE  = 2,       // Stereo speaker output without external PA ,  [stereo wave -> two mono mixer -> stereo wave ->LSP&LO PGA -> stereo Speaker output]
    SPK_STEREO_EX_PA_PROFILE = 3,       // Stereo speaker output with external PA , [stereo wave -> two mono mixer -> stereo wave ->LSP&LO PGA -> External PA -> stereo Speaker output]
    SPK_MONO_DOUBLE_ONLY_PROFILE = 4,   // Double speaker output without external PA,  [stereo wave -> two mono mixer -> mono wave -> LSP&LO PGA -> double Speaker output]
    SPK_MONO_DOUBLE_EX_PA_PROFILE = 5   // Double speaker output with external PA ,  [stereo wave -> two mono mixer -> mono wave -> LSP&LO PGA -> External PA -> double Speaker output]
}ESPEAKEROUTPROFILE, *PESPEAKEROUTPROFILE;
//==========================================================================


//==========================================================================
// [struct] Define PGA's volume ramp up and down
//==========================
typedef struct _CODEC_RAMP_PGA_VOL
{
    BOOL bHsVolRampUp;        // TRUE is to ramp up headset ouput PGA volume, FALSE not
    BOOL bHsVolRampDown;      // TRUE is to ramp down headset ouput PGA volume, FALSE not 
    BOOL bSpkVolRampUp;       // TRUE is to ramp up speaker ouput PGA volume, FALSE not 
    BOOL bSpkVolRampDown;     // NOT USED after B835 release, just reserved
    BOOL bRecvVolRampUp;      // TRUE is to ramp up receiver ouput PGA volume, FALSE not 
    BOOL bRecvVolRampDown;    // TRUE is to ramp down receiver ouput PGA volume, FALSE not 
    BOOL bMicVolRampUp;       // TRUE is to ramp up microphone input PGA volume, FALSE not
    BOOL bMicVolRampDown;     // NOT USED after B835 release , just reserved
    BOOL bSideVolRampUp;      // TRUE is to ramp up sidetone input PGA volume, FALSE not
    BOOL bSideVolRampDown;    // NOT USED after B835 release, just reserved
    BOOL bLoVolRampUp;        // TRUE is to ramp up lineout input PGA volume, FALSE not
    BOOL bLoVolRampDown;      // NOT USED after B835 release, just reserved
    BOOL bLi2VolRampUp;       // TRUE is to ramp up linein2 input PGA volume, FALSE not
    BOOL bLi2VolRampDown;     // NOT USED after B835 release, just reserved
}CODECRAMPPGAVOL, *PCODECRAMPPGAVOL;
//==========================================================================


//==========================================================================
// [struct] Define phone linein/lineout volume map
//==========================
typedef struct _CODEC_LINEINOUT_VOL
{
    UCHAR ucLineInFm;        // FM in
    UCHAR ucLineInRecv;      // Phone downlink input pga for recevier
    UCHAR ucLineInSpk;       // Phone downlink input pga for speaker
    UCHAR ucLineInHs;        // Phone downlink input pga for headset
    UCHAR ucLineInBt;        // Phone downlink input pga for BT headset
    UCHAR ucLineOutBdMic;    // Phone uplink channel output pga for board mic
    UCHAR ucLineOutSpkMic;   // Phone uplink channel output pga for speaker mic
    UCHAR ucLineOutHsMic;    // Phone uplink channel output pga for headset mic
    UCHAR ucLineOutBtMic;    // Phone uplink channel output pga for BT mic
    UCHAR ucPading1;
    UCHAR ucPading2;
    UCHAR ucPading3;
}CODECLINEINOUTVOL, *PCODECLINEINOUTVOL;
//==========================================================================


//==========================================================================
// [struct] Define microphone amp volume map 
//==========================
typedef struct _CODEC_MICAMP_VOL
{
    UCHAR ucBdAmpBst1;    // board mic AMP boost 
    UCHAR ucBdAmpVol;     // board mic AMP volume
    UCHAR ucHsAmpBst1;    // headset mic AMP boost 
    UCHAR ucHsAmpVol;     // headset mic AMP volume 
    UCHAR ucBdAmpBst2;    // board mic AMP boost2 
    UCHAR ucHsAmpBst2;    // headset mic AMP boost2
    USHORT usAdcVol;      // ADC volume
    
}CODECMICAMPVOL, *PCODECMICAMPVOL;
//==========================================================================


//==========================================================================
// [struct] Define phone sidetone volume map 
//==========================
typedef struct _CODEC_UPLINKSIDE_VOL
{
    UCHAR ucReserved;          // Reserved
    UCHAR ucRecvMicSideVol;    // Board Mic input uplink side pga volume when receiver as the downlink
    UCHAR ucSpkMicSideVol;     // Board Mic input uplink  side pga volume when speaker as the downlink
    UCHAR ucHsMicSideVol;      // Headset Mic input uplink  side pga volume when headset as the downlink
}CODECUPLINKSIDEVOL, *PCODECSIDETONEVOL;
//==========================================================================


//==========================================================================
// [struct] Define phone left and right DAV volume map 
//==========================
typedef struct _CODEC_CALLWAVEDACLR_VOL
{
    DWORD dwDacLRReceiver;       // Left and right DAC volume when receiver call
    DWORD dwDacLRSpeaker;        // Left and right DAC volume when speaker call
    DWORD dwDacLRHeadset;        // Left and right DAC volume when headset call
    DWORD dwDacLRBluetooth;      // Left and right DAC volume when bluetooth call
}CODECCALLWAVEDACLRVOL, *PCODECCALLWAVEDACLRVOL;
//==========================================================================


//==========================================================================
// [struct] Define device volume map for whole system volume dymatic control
//==========================
typedef struct _CODEC6421_VOLUME_MAP
{
    //------------------------------------
    //-----WAVE PLAY VIEW-----------------
    // BIT[31:16]-left DAC volume,
    // range from 0~0xFFFF, default 0xFFFF;
    // BIT[15:0]-left DAC volume,
    // range from 0~0xFFFF, default 0xFFFF;
    DWORD dwCodecWaveDacV;  // default 0xFFFFFFFF

    // BIT[31:24]-receiver PA volume;
    // BIT[23:16]-speaker PA volume,
    // range from 0~14,  default 14;
    // BIT[15:8]-left headset  volume,
    // range from 0~13,  default 12;
    // BIT[7:0]-Right headset  volume,
    // range from 0~13,  default 12;
    DWORD dwCodecWaveRecvSpkHsV;    // default 0xFF0E0C0C
    //-----WAVE PLAY VIEW-----------------
    //------------------------------------

    //------------------------------------
    // -----Communication/FM VIEW-----------
    // BIT[31:24]-receiver PA volume,
    // range from 0~14,  default 13;
    // BIT[23:16]-speaker PA volume, 
    // range from 0~16,  default 16;
    // BIT[15:8]-left headset  volume,
    // range from 0~13,  default 12;
    // BIT[7:0]-right headset  volume,
    // range from 0~13,  default 12;
    DWORD dwCodecCallRecvSpkHsV;    // default 0x0D100C0C, not use after B865 release
    
    // BIT[31:24]-linein1 volume for FM, 
    // range from 0~8, default 4;
    // BIT[23:16]-linein2 volume, 
    // range from 0~15, default 10;
    // BIT[15:8]-lineout  volume,
    // range from 0~14, default 7;
    // BIT[7:0]-Speaker mic to lineout,
    // range from 0~15, default 10;
    DWORD dwCodecCallLineInOutV;    // default 0x040A0707, not use after B865 release
    
    // BIT[31:24]-board mic boost setting,
    // range from 0~1, default 1;
    // BIT[23:16]-board mic AMP1 volume, 
    // range from 0~10, default 8;
    // BIT[15:8]-headset mic boost setting,
    // range from 0~1, default 1;
    // BIT[7:0]-headset mic AMP1 volume,
    // range from 0~10, default 8;
    DWORD dwCodecCallMicBstAmpV;    // default 0x01080108

    // BIT[31:24]-reserved,
    // BIT[23:16]-board mic input uplink side pga volume when receiver as the downlink,
    // range from 0~15, default 10;
    // BIT[15:8]-board mic input uplink side pga volume when speaker as the downlink,
    // range from 0~15, default 3;
    // BIT[7:0]-headset mic input uplink side pga volume when headset as the downlink,
    // range from 0~15, default 10;
    DWORD dwCodecCallUplinkSideV;    // default 0x000F0E0F

    // BIT[31:16]-bluetooth DAC volume,
    // range from 0~0xFFFF, default 0xFFFF;
    // BIT[15:0]-bluetooth ADC volume,
    // range from 0~0xFFFF, default 0xF1AD;
    DWORD dwCodecCallBtDacAdcV;    // default 0xFFFFF1AD
    // -----Communication/FM VIEW-----------
    //------------------------------------

    //------------------------------------
    //-----WAVE IN (Record) VIEW------------
    // BIT[31:24]-board mic boost setting,
    // range from 0~1, default 1;
    // BIT[23:16]-board mic AMP1 volume, 
    // range from 0~10, default 8;
    // BIT[15:8]-headset mic boost setting,
    // range from 0~1, default 1;
    // BIT[7:0]-headset mic AMP1 volume,
    // range from 0~10, default 8;
    DWORD dwCodecRecMicBstAmpV;    // default 0x01080108
                                        
    // BIT[31:24]-board mic boost2 setting,
    // range from 0~1, default 0;
    // BIT[23:16]-headset mic boost2 setting,
    // range from 0~1, default 0;
    // BIT[15:0]- wave in ADC volume;
    // range from 0~0xFFFF, default 0xF1AD;
    DWORD dwCodecRecBst2AdcV;    // default 0x0000F1AD   
    //-----WAVE IN (Record) VIEW------------
    //------------------------------------   

    // Device volume mapping table
    UCHAR pucDVMT[DEVICE_GAIN_NUM][OUTPUTPGA_GAIN_NUM][OUTPUTGAIN_LEVEL_NUM];    // default copy of array of g_ppSystemDevVolMap

    // Phone linein/lineout volume mapping struct
    struct _CODEC_LINEINOUT_VOL sLineInOutV;

    // Phone microphone AMP volume and boost mapping struct
    struct _CODEC_MICAMP_VOL sCallMicAmpV;

    // Record microphone AMP volume and boost mapping struct
    struct _CODEC_MICAMP_VOL sRecMicAmpV;

    // Phone sidetone volume mapping struct
    struct _CODEC_UPLINKSIDE_VOL sCallUplinkSideV;
    
    // Phone left and right DAC volume on defferent call channel
    struct _CODEC_CALLWAVEDACLR_VOL sCallDacLRV;
    
}CODEC6421VOLUMEMAP, *PCODEC6421VOLUMEMAP;
//==========================================================================



#endif  // __ACODECBASE_H__


